/*
********************************************************************************
* Copyright (C) 2021, xiang.D <dx_65535@163.com>.
* All right reserved.
*
* File Name   : app_view.h
* Author      :
* Version     : V1.0
* Description :
* Journal     : 2021-1-27 version v1.0
* Brief       : Blog: https://blog.csdn.net/qq_38750572?spm=1001.2014.3001.5343
* Others      :
                Compile command: make
********************************************************************************
*/

#ifndef __APP_VIEW_H__
#define __APP_VIEW_H__

typedef struct
{
    int locX;
    int locY;
} SClickLocation;

class CViewBase
{
public:
    CViewBase()
    {}

    virtual ~CViewBase()
    {}

    virtual void SetNextHandler(CViewBase* handler) = 0;

    virtual void HandleRequest(void *request) = 0;
};

class CChromeView : public CViewBase
{
public:
    explicit CChromeView(int XBegin, int XEnd, int YBegin, int YEnd);

    void SetNextHandler(CViewBase* handler);

    void HandleRequest(void *request);

    bool IsSelect(SClickLocation *location);

private:
    int mXBegin;
    int mXEnd;
    int mYBegin;
    int mYEnd;
    CViewBase *mNextHandler;
};

class CTimView : public CViewBase
{
public:
    explicit CTimView(int XBegin, int XEnd, int YBegin, int YEnd);

    void SetNextHandler(CViewBase* handler);

    void HandleRequest(void *request);

    bool IsSelect(SClickLocation *location);

private:
    int mXBegin;
    int mXEnd;
    int mYBegin;
    int mYEnd;
    CViewBase *mNextHandler;
};

class CWeChatView : public CViewBase
{
public:
    explicit CWeChatView(int XBegin, int XEnd, int YBegin, int YEnd);

    void SetNextHandler(CViewBase* handler);

    void HandleRequest(void *request);

    bool IsSelect(SClickLocation *location);

private:
    int mXBegin;
    int mXEnd;
    int mYBegin;
    int mYEnd;
    CViewBase *mNextHandler;
};

#endif

